<?php
/**
 * TransferPreviewApiTest
 * PHP version 8.3
 *
 * @category Class
 * @package  SpApi
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * The Selling Partner API for Amazon Seller Wallet Open Banking API
 *
 * The Selling Partner API for Seller Wallet (Seller Wallet API) provides financial information that is relevant to a seller's Seller Wallet account. You can obtain financial events, balances, and transfer schedules for Seller Wallet accounts. You can also schedule and initiate transactions.
 *
 * The version of the OpenAPI document: 2024-03-01
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.9.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Please update the test case below to test the endpoint.
 */

namespace SpApi\Test\Api;

use SpApi\ApiException;
use SpApi\Api\sellerWallet\v2024_03_01\TransferPreviewApi;
use SpApi\ObjectSerializer;

/**
 * TransferPreviewApiTest Class Doc Comment
 *
 * @category Class
 * @package  SpApi
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */
class TransferPreviewApiTest extends BaseTestCase
{
    private TransferPreviewApi $apiInstance;
    public function setUp(): void
    {
        parent::setUp();
        // Initialize parameter value specific to case
        $this->testHelper->setSpecificValue('TransferPreviewApi', $this->getName());
        $this->apiInstance = new TransferPreviewApi($this->config, null);
        // Change Time Format if it requires
        $specificTimeFormat = $this->testHelper->getDateTimeFormatForCase('TransferPreviewApi');
        if ($specificTimeFormat) {
            ObjectSerializer::setDateTimeFormat($specificTimeFormat);
        }
    }

    /**
     * Test case for getTransferPreview_200
     */
    public function testGetTransferPreview200()
    {
        try {
            // Skip test if it is in the skip list
            if ($this->testHelper->shouldSkipTest('testGetTransferPreview200', 'TransferPreviewApi')) {
                $this->assertTrue(true);
                return;
            }
            $jsonSchema = '{
  &quot;description&quot; : &quot;Success&quot;,
  &quot;headers&quot; : {
    &quot;x-amzn-RequestId&quot; : {
      &quot;description&quot; : &quot;Unique request reference identifier.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    },
    &quot;x-amzn-RateLimit-Limit&quot; : {
      &quot;description&quot; : &quot;Your rate limit (requests per second) for this operation.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    }
  },
  &quot;content&quot; : {
    &quot;application/json&quot; : {
      &quot;schema&quot; : {
        &quot;$ref&quot; : &quot;#/components/schemas/TransferRatePreview&quot;
      }
    }
  },
  &quot;x-amzn-api-sandbox&quot; : {
    &quot;static&quot; : [ {
      &quot;request&quot; : {
        &quot;parameters&quot; : {
          &quot;sourceCountryCode&quot; : {
            &quot;value&quot; : &quot;EU&quot;
          },
          &quot;sourceCurrencyCode&quot; : {
            &quot;value&quot; : &quot;EUR&quot;
          },
          &quot;destinationCountryCode&quot; : {
            &quot;value&quot; : &quot;CN&quot;
          },
          &quot;destinationCurrencyCode&quot; : {
            &quot;value&quot; : &quot;CNY&quot;
          },
          &quot;baseAmount&quot; : {
            &quot;value&quot; : 500.0
          }
        }
      },
      &quot;response&quot; : {
        &quot;baseAmount&quot; : {
          &quot;currencyCode&quot; : &quot;EUR&quot;,
          &quot;currencyAmount&quot; : 500.0
        },
        &quot;fxRateDetails&quot; : {
          &quot;fxRateId&quot; : &quot;UNIQUE_FX_RATE_ID_1&quot;,
          &quot;baseRate&quot; : 7.6915,
          &quot;effectiveFxRate&quot; : 7.6084,
          &quot;rateDirection&quot; : &quot;BUY&quot;
        },
        &quot;transferAmount&quot; : {
          &quot;currencyCode&quot; : &quot;CNY&quot;,
          &quot;currencyAmount&quot; : 3804.2
        },
        &quot;fees&quot; : [ {
          &quot;feeId&quot; : &quot;Unique_FeeId_001&quot;,
          &quot;feeType&quot; : &quot;TRANSACTION_FEE&quot;,
          &quot;feeRateValue&quot; : 0.9,
          &quot;feeAmount&quot; : {
            &quot;currencyCode&quot; : &quot;EUR&quot;,
            &quot;currencyAmount&quot; : 4.5
          }
        }, {
          &quot;feeId&quot; : &quot;Unique_FeeId_002&quot;,
          &quot;feeType&quot; : &quot;TAX&quot;,
          &quot;feeRateValue&quot; : 20.0,
          &quot;feeAmount&quot; : {
            &quot;currencyCode&quot; : &quot;EUR&quot;,
            &quot;currencyAmount&quot; : 0.9
          }
        } ]
      }
    } ]
  }
}';
            $result = $this->testHelper->extractRequestAndResponse(
                $this->apiInstance,
                $jsonSchema,
                'getTransferPreview'
            );
            $requestParams = $result['requestParams'];
            $expectedResponse = $result['expectedResponse'];

            // Change Time Format if it requires
            $specificTimeFormat = $this->testHelper->getDateTimeFormatForCase('TransferPreviewApi');
            if ($specificTimeFormat) {
                ObjectSerializer::setDateTimeFormat($specificTimeFormat);
            }

            // Act: Call API
            list($response, $statusCode, $headers) =
                $this->apiInstance->getTransferPreviewWithHttpInfo(...array_values($requestParams));

            // Assert the response code
            $this->assertHttpStatusCode(200, $statusCode);

            // Handle different response codes
            $this->handleResponse($response, $statusCode, 200, $expectedResponse);
        } catch (ApiException $e) {
            $this->handleApiException($e, 200);
        } catch (\ReflectionException $e) {
            $this->fail("Reflection exception: " . $e->getMessage());
        }
    }
    /**
     * Test case for getTransferPreview_400
     */
    public function testGetTransferPreview400()
    {
        try {
            // Skip test if it is in the skip list
            if ($this->testHelper->shouldSkipTest('testGetTransferPreview400', 'TransferPreviewApi')) {
                $this->assertTrue(true);
                return;
            }
            $jsonSchema = '{
  &quot;description&quot; : &quot;Request has missing or invalid parameters and cannot be parsed.&quot;,
  &quot;headers&quot; : {
    &quot;x-amzn-RequestId&quot; : {
      &quot;description&quot; : &quot;Unique request reference identifier.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    },
    &quot;x-amzn-RateLimit-Limit&quot; : {
      &quot;description&quot; : &quot;Your rate limit (requests per second) for this operation.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    }
  },
  &quot;content&quot; : {
    &quot;application/json&quot; : {
      &quot;schema&quot; : {
        &quot;$ref&quot; : &quot;#/components/schemas/ErrorList&quot;
      }
    }
  },
  &quot;x-amzn-api-sandbox&quot; : {
    &quot;static&quot; : [ {
      &quot;request&quot; : {
        &quot;parameters&quot; : {
          &quot;sourceCountryCode&quot; : {
            &quot;value&quot; : &quot;AP&quot;
          }
        }
      },
      &quot;response&quot; : {
        &quot;errors&quot; : [ {
          &quot;code&quot; : &quot;InvalidInput&quot;,
          &quot;message&quot; : &quot;Invalid or Missing Input Parameter.&quot;,
          &quot;details&quot; : &quot;Invalid sourceCountryCode&quot;
        }, {
          &quot;code&quot; : &quot;InvalidInput&quot;,
          &quot;message&quot; : &quot;Invalid or Missing Input Parameter.&quot;,
          &quot;details&quot; : &quot;Missing destinationCurrencyCode&quot;
        } ]
      }
    } ]
  }
}';
            $result = $this->testHelper->extractRequestAndResponse(
                $this->apiInstance,
                $jsonSchema,
                'getTransferPreview'
            );
            $requestParams = $result['requestParams'];
            $expectedResponse = $result['expectedResponse'];

            // Change Time Format if it requires
            $specificTimeFormat = $this->testHelper->getDateTimeFormatForCase('TransferPreviewApi');
            if ($specificTimeFormat) {
                ObjectSerializer::setDateTimeFormat($specificTimeFormat);
            }

            // Act: Call API
            list($response, $statusCode, $headers) =
                $this->apiInstance->getTransferPreviewWithHttpInfo(...array_values($requestParams));

            // Assert the response code
            $this->assertHttpStatusCode(400, $statusCode);

            // Handle different response codes
            $this->handleResponse($response, $statusCode, 400, $expectedResponse);
        } catch (ApiException $e) {
            $this->handleApiException($e, 400);
        } catch (\ReflectionException $e) {
            $this->fail("Reflection exception: " . $e->getMessage());
        }
    }
    /**
     * Test case for getTransferPreview_403
     */
    public function testGetTransferPreview403()
    {
        try {
            // Skip test if it is in the skip list
            if ($this->testHelper->shouldSkipTest('testGetTransferPreview403', 'TransferPreviewApi')) {
                $this->assertTrue(true);
                return;
            }
            $jsonSchema = '{
  &quot;description&quot; : &quot;Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.&quot;,
  &quot;headers&quot; : {
    &quot;x-amzn-RequestId&quot; : {
      &quot;description&quot; : &quot;Unique request reference identifier.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    }
  },
  &quot;content&quot; : {
    &quot;application/json&quot; : {
      &quot;schema&quot; : {
        &quot;$ref&quot; : &quot;#/components/schemas/ErrorList&quot;
      }
    }
  },
  &quot;x-amzn-api-sandbox&quot; : {
    &quot;static&quot; : [ {
      &quot;request&quot; : {
        &quot;parameters&quot; : {
          &quot;sourceCountryCode&quot; : {
            &quot;value&quot; : &quot;US&quot;
          },
          &quot;destinationCountryCode&quot; : {
            &quot;value&quot; : &quot;US&quot;
          }
        }
      },
      &quot;response&quot; : {
        &quot;errors&quot; : [ {
          &quot;code&quot; : &quot;UnauthorizedRequest&quot;,
          &quot;message&quot; : &quot;Invalid WAC certificate.&quot;,
          &quot;details&quot; : &quot;NCA Status for the certificate is invalid&quot;
        } ]
      }
    } ]
  }
}';
            $result = $this->testHelper->extractRequestAndResponse(
                $this->apiInstance,
                $jsonSchema,
                'getTransferPreview'
            );
            $requestParams = $result['requestParams'];
            $expectedResponse = $result['expectedResponse'];

            // Change Time Format if it requires
            $specificTimeFormat = $this->testHelper->getDateTimeFormatForCase('TransferPreviewApi');
            if ($specificTimeFormat) {
                ObjectSerializer::setDateTimeFormat($specificTimeFormat);
            }

            // Act: Call API
            list($response, $statusCode, $headers) =
                $this->apiInstance->getTransferPreviewWithHttpInfo(...array_values($requestParams));

            // Assert the response code
            $this->assertHttpStatusCode(403, $statusCode);

            // Handle different response codes
            $this->handleResponse($response, $statusCode, 403, $expectedResponse);
        } catch (ApiException $e) {
            $this->handleApiException($e, 403);
        } catch (\ReflectionException $e) {
            $this->fail("Reflection exception: " . $e->getMessage());
        }
    }
    /**
     * Test case for getTransferPreview_404
     */
    public function testGetTransferPreview404()
    {
        try {
            // Skip test if it is in the skip list
            if ($this->testHelper->shouldSkipTest('testGetTransferPreview404', 'TransferPreviewApi')) {
                $this->assertTrue(true);
                return;
            }
            $jsonSchema = '{
  &quot;description&quot; : &quot;The resource specified does not exist.&quot;,
  &quot;headers&quot; : {
    &quot;x-amzn-RequestId&quot; : {
      &quot;description&quot; : &quot;Unique request reference identifier.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    },
    &quot;x-amzn-RateLimit-Limit&quot; : {
      &quot;description&quot; : &quot;Your rate limit (requests per second) for this operation.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    }
  },
  &quot;content&quot; : {
    &quot;application/json&quot; : {
      &quot;schema&quot; : {
        &quot;$ref&quot; : &quot;#/components/schemas/ErrorList&quot;
      }
    }
  },
  &quot;x-amzn-api-sandbox&quot; : {
    &quot;static&quot; : [ {
      &quot;request&quot; : {
        &quot;parameters&quot; : {
          &quot;sourceCountryCode&quot; : {
            &quot;value&quot; : &quot;US&quot;
          },
          &quot;sourceCurrencyCode&quot; : {
            &quot;value&quot; : &quot;USD&quot;
          },
          &quot;destinationCountryCode&quot; : {
            &quot;value&quot; : &quot;US&quot;
          },
          &quot;destinationCurrencyCode&quot; : {
            &quot;value&quot; : &quot;USD&quot;
          }
        }
      },
      &quot;response&quot; : {
        &quot;errors&quot; : [ {
          &quot;code&quot; : &quot;NotFound&quot;,
          &quot;message&quot; : &quot;BankAccount not found.&quot;,
          &quot;details&quot; : &quot;BankAccount doesn&#39;t exists for InvalidAccountId&quot;
        } ]
      }
    } ]
  }
}';
            $result = $this->testHelper->extractRequestAndResponse(
                $this->apiInstance,
                $jsonSchema,
                'getTransferPreview'
            );
            $requestParams = $result['requestParams'];
            $expectedResponse = $result['expectedResponse'];

            // Change Time Format if it requires
            $specificTimeFormat = $this->testHelper->getDateTimeFormatForCase('TransferPreviewApi');
            if ($specificTimeFormat) {
                ObjectSerializer::setDateTimeFormat($specificTimeFormat);
            }

            // Act: Call API
            list($response, $statusCode, $headers) =
                $this->apiInstance->getTransferPreviewWithHttpInfo(...array_values($requestParams));

            // Assert the response code
            $this->assertHttpStatusCode(404, $statusCode);

            // Handle different response codes
            $this->handleResponse($response, $statusCode, 404, $expectedResponse);
        } catch (ApiException $e) {
            $this->handleApiException($e, 404);
        } catch (\ReflectionException $e) {
            $this->fail("Reflection exception: " . $e->getMessage());
        }
    }
    /**
     * Test case for getTransferPreview_408
     */
    public function testGetTransferPreview408()
    {
        try {
            // Skip test if it is in the skip list
            if ($this->testHelper->shouldSkipTest('testGetTransferPreview408', 'TransferPreviewApi')) {
                $this->assertTrue(true);
                return;
            }
            $jsonSchema = '{
  &quot;description&quot; : &quot;Request Timed Out.&quot;,
  &quot;headers&quot; : {
    &quot;x-amzn-RequestId&quot; : {
      &quot;description&quot; : &quot;Unique request reference identifier.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    }
  },
  &quot;content&quot; : {
    &quot;application/json&quot; : {
      &quot;schema&quot; : {
        &quot;$ref&quot; : &quot;#/components/schemas/ErrorList&quot;
      }
    }
  },
  &quot;x-amzn-api-sandbox&quot; : {
    &quot;static&quot; : [ {
      &quot;request&quot; : {
        &quot;parameters&quot; : {
          &quot;sourceCountryCode&quot; : {
            &quot;value&quot; : &quot;US&quot;
          },
          &quot;destinationCountryCode&quot; : {
            &quot;value&quot; : &quot;HK&quot;
          }
        }
      },
      &quot;response&quot; : {
        &quot;errors&quot; : [ {
          &quot;code&quot; : &quot;RequestTimedOut&quot;,
          &quot;message&quot; : &quot;Request Timed Out&quot;,
          &quot;details&quot; : &quot;Server did not respond in time&quot;
        } ]
      }
    } ]
  }
}';
            $result = $this->testHelper->extractRequestAndResponse(
                $this->apiInstance,
                $jsonSchema,
                'getTransferPreview'
            );
            $requestParams = $result['requestParams'];
            $expectedResponse = $result['expectedResponse'];

            // Change Time Format if it requires
            $specificTimeFormat = $this->testHelper->getDateTimeFormatForCase('TransferPreviewApi');
            if ($specificTimeFormat) {
                ObjectSerializer::setDateTimeFormat($specificTimeFormat);
            }

            // Act: Call API
            list($response, $statusCode, $headers) =
                $this->apiInstance->getTransferPreviewWithHttpInfo(...array_values($requestParams));

            // Assert the response code
            $this->assertHttpStatusCode(408, $statusCode);

            // Handle different response codes
            $this->handleResponse($response, $statusCode, 408, $expectedResponse);
        } catch (ApiException $e) {
            $this->handleApiException($e, 408);
        } catch (\ReflectionException $e) {
            $this->fail("Reflection exception: " . $e->getMessage());
        }
    }
    /**
     * Test case for getTransferPreview_413
     */
    public function testGetTransferPreview413()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for getTransferPreview_415
     */
    public function testGetTransferPreview415()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for getTransferPreview_429
     */
    public function testGetTransferPreview429()
    {
        try {
            // Skip test if it is in the skip list
            if ($this->testHelper->shouldSkipTest('testGetTransferPreview429', 'TransferPreviewApi')) {
                $this->assertTrue(true);
                return;
            }
            $jsonSchema = '{
  &quot;description&quot; : &quot;The frequency of requests was greater than allowed.&quot;,
  &quot;headers&quot; : {
    &quot;x-amzn-RequestId&quot; : {
      &quot;description&quot; : &quot;Unique request reference identifier.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    }
  },
  &quot;content&quot; : {
    &quot;application/json&quot; : {
      &quot;schema&quot; : {
        &quot;$ref&quot; : &quot;#/components/schemas/ErrorList&quot;
      }
    }
  },
  &quot;x-amzn-api-sandbox&quot; : {
    &quot;static&quot; : [ {
      &quot;request&quot; : {
        &quot;parameters&quot; : {
          &quot;sourceCountryCode&quot; : {
            &quot;value&quot; : &quot;HK&quot;
          },
          &quot;destinationCountryCode&quot; : {
            &quot;value&quot; : &quot;HK&quot;
          }
        }
      },
      &quot;response&quot; : {
        &quot;errors&quot; : [ {
          &quot;code&quot; : &quot;RequestThrottled&quot;,
          &quot;message&quot; : &quot;Request Throttled&quot;,
          &quot;details&quot; : &quot;Server throttled the request&quot;
        } ]
      }
    } ]
  }
}';
            $result = $this->testHelper->extractRequestAndResponse(
                $this->apiInstance,
                $jsonSchema,
                'getTransferPreview'
            );
            $requestParams = $result['requestParams'];
            $expectedResponse = $result['expectedResponse'];

            // Change Time Format if it requires
            $specificTimeFormat = $this->testHelper->getDateTimeFormatForCase('TransferPreviewApi');
            if ($specificTimeFormat) {
                ObjectSerializer::setDateTimeFormat($specificTimeFormat);
            }

            // Act: Call API
            list($response, $statusCode, $headers) =
                $this->apiInstance->getTransferPreviewWithHttpInfo(...array_values($requestParams));

            // Assert the response code
            $this->assertHttpStatusCode(429, $statusCode);

            // Handle different response codes
            $this->handleResponse($response, $statusCode, 429, $expectedResponse);
        } catch (ApiException $e) {
            $this->handleApiException($e, 429);
        } catch (\ReflectionException $e) {
            $this->fail("Reflection exception: " . $e->getMessage());
        }
    }
    /**
     * Test case for getTransferPreview_500
     */
    public function testGetTransferPreview500()
    {
        try {
            // Skip test if it is in the skip list
            if ($this->testHelper->shouldSkipTest('testGetTransferPreview500', 'TransferPreviewApi')) {
                $this->assertTrue(true);
                return;
            }
            $jsonSchema = '{
  &quot;description&quot; : &quot;An unexpected condition occurred that prevented the server from fulfilling the request.&quot;,
  &quot;headers&quot; : {
    &quot;x-amzn-RequestId&quot; : {
      &quot;description&quot; : &quot;Unique request reference identifier.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    }
  },
  &quot;content&quot; : {
    &quot;application/json&quot; : {
      &quot;schema&quot; : {
        &quot;$ref&quot; : &quot;#/components/schemas/ErrorList&quot;
      }
    }
  },
  &quot;x-amzn-api-sandbox&quot; : {
    &quot;static&quot; : [ {
      &quot;request&quot; : {
        &quot;parameters&quot; : {
          &quot;sourceCountryCode&quot; : {
            &quot;value&quot; : &quot;EU&quot;
          },
          &quot;destinationCountryCode&quot; : {
            &quot;value&quot; : &quot;EU&quot;
          }
        }
      },
      &quot;response&quot; : {
        &quot;errors&quot; : [ {
          &quot;code&quot; : &quot;InternalServerError&quot;,
          &quot;message&quot; : &quot;Internal Server Error&quot;,
          &quot;details&quot; : &quot;Internal Server Error Occurred&quot;
        } ]
      }
    } ]
  }
}';
            $result = $this->testHelper->extractRequestAndResponse(
                $this->apiInstance,
                $jsonSchema,
                'getTransferPreview'
            );
            $requestParams = $result['requestParams'];
            $expectedResponse = $result['expectedResponse'];

            // Change Time Format if it requires
            $specificTimeFormat = $this->testHelper->getDateTimeFormatForCase('TransferPreviewApi');
            if ($specificTimeFormat) {
                ObjectSerializer::setDateTimeFormat($specificTimeFormat);
            }

            // Act: Call API
            list($response, $statusCode, $headers) =
                $this->apiInstance->getTransferPreviewWithHttpInfo(...array_values($requestParams));

            // Assert the response code
            $this->assertHttpStatusCode(500, $statusCode);

            // Handle different response codes
            $this->handleResponse($response, $statusCode, 500, $expectedResponse);
        } catch (ApiException $e) {
            $this->handleApiException($e, 500);
        } catch (\ReflectionException $e) {
            $this->fail("Reflection exception: " . $e->getMessage());
        }
    }
    /**
     * Test case for getTransferPreview_503
     */
    public function testGetTransferPreview503()
    {
        try {
            // Skip test if it is in the skip list
            if ($this->testHelper->shouldSkipTest('testGetTransferPreview503', 'TransferPreviewApi')) {
                $this->assertTrue(true);
                return;
            }
            $jsonSchema = '{
  &quot;description&quot; : &quot;Temporary overloading or maintenance of the server.&quot;,
  &quot;headers&quot; : {
    &quot;x-amzn-RequestId&quot; : {
      &quot;description&quot; : &quot;Unique request reference identifier.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    }
  },
  &quot;content&quot; : {
    &quot;application/json&quot; : {
      &quot;schema&quot; : {
        &quot;$ref&quot; : &quot;#/components/schemas/ErrorList&quot;
      }
    }
  },
  &quot;x-amzn-api-sandbox&quot; : {
    &quot;static&quot; : [ {
      &quot;request&quot; : {
        &quot;parameters&quot; : {
          &quot;sourceCountryCode&quot; : {
            &quot;value&quot; : &quot;CN&quot;
          },
          &quot;destinationCountryCode&quot; : {
            &quot;value&quot; : &quot;CN&quot;
          }
        }
      },
      &quot;response&quot; : {
        &quot;errors&quot; : [ {
          &quot;code&quot; : &quot;ServiceUnavailable&quot;,
          &quot;message&quot; : &quot;Server Unavailable&quot;,
          &quot;details&quot; : &quot;Server is not accepting request&quot;
        } ]
      }
    } ]
  }
}';
            $result = $this->testHelper->extractRequestAndResponse(
                $this->apiInstance,
                $jsonSchema,
                'getTransferPreview'
            );
            $requestParams = $result['requestParams'];
            $expectedResponse = $result['expectedResponse'];

            // Change Time Format if it requires
            $specificTimeFormat = $this->testHelper->getDateTimeFormatForCase('TransferPreviewApi');
            if ($specificTimeFormat) {
                ObjectSerializer::setDateTimeFormat($specificTimeFormat);
            }

            // Act: Call API
            list($response, $statusCode, $headers) =
                $this->apiInstance->getTransferPreviewWithHttpInfo(...array_values($requestParams));

            // Assert the response code
            $this->assertHttpStatusCode(503, $statusCode);

            // Handle different response codes
            $this->handleResponse($response, $statusCode, 503, $expectedResponse);
        } catch (ApiException $e) {
            $this->handleApiException($e, 503);
        } catch (\ReflectionException $e) {
            $this->fail("Reflection exception: " . $e->getMessage());
        }
    }
}
